import { api, TWsClient } from "../../assets/api.js"


class TAdmin {
    constructor() {
        this.api = api;
    };
    checkSessionUserInfo(appCode) {
        var me = this;
        var res = {
            status: 0,
            appCode: appCode,
            userInfo: {}
        };
        return Promise((su, fa) => {
            try {
                var key = "zniot_" + appCode + 'userInfo';
                content = window.localStorage.getItem(key);
                if (content && content != null && content.length > 10) {
                    res.status = 1;
                    res.userInfo = JSON.parse(content);
                    su(res)
                } else {
                    su(res)
                }
            } catch (error) {
                console.log(error);
                su(res)
            }
        })
    }
}
const admin = new TAdmin();
admin.api.dbCode = 'znpower2025';
export { admin }